summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-02-24 18:50:54 +0100
committerLiam <byteslice@airmail.cc>2023-02-24 18:50:54 +0100
commit975186ad4d7c67b22f580986979d0520530b41c3 (patch)
tree2f019508809c88a3576f82c7bd16772b15c2c61d
parenthid: avoid direct pointer access of transfer memory objects (diff)
downloadyuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar.gz
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar.bz2
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar.lz
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar.xz
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.tar.zst
yuzu-975186ad4d7c67b22f580986979d0520530b41c3.zip
-rw-r--r--src/core/hle/service/am/am.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index beb2da06e..adb482941 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1260,9 +1260,8 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
return;
}
- const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
- const u8* const mem_end = mem_begin + transfer_mem->GetSize();
- std::vector<u8> memory{mem_begin, mem_end};
+ std::vector<u8> memory(transfer_mem->GetSize());
+ system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
@@ -1294,9 +1293,8 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
return;
}
- const u8* const mem_begin = system.Memory().GetPointer(transfer_mem->GetSourceAddress());
- const u8* const mem_end = mem_begin + transfer_mem->GetSize();
- std::vector<u8> memory{mem_begin, mem_end};
+ std::vector<u8> memory(transfer_mem->GetSize());
+ system.Memory().ReadBlock(transfer_mem->GetSourceAddress(), memory.data(), memory.size());
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);